import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
// 引入组件
import main from "@/components/main";
import home from "../views/home.vue";
import about from "../views/about.vue";
import page1 from "../views/page1.vue";
import page2 from "../views/page2.vue";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'main',
      component: main
    },
    {
      path:"/home",
      component: home,
      children:[
        {
          path: 'page1',
          components:{
            container: page1
          },
        },
        {
          path: 'page2',
          components:{
            container: page2
          },
        }
      ]
    },
    {
      path: "/about",
      component: about
    }
  ]
})
